/*
 *@description:编辑界面
 *@author: donghang
 *@date: 2019-08-27 10:23:49
 *@version: V1.0.0
 *@modify：2020.4.13，修改url定义方式，增加默认url，整理代码中方法排列顺序by zhanglongfei
 *必填数据：
 param1：
    urlPrefix：模块url前缀，前后带/，如/cbo/user/
  param2:
    moduleTitle: '模块名称',  //打开编辑框动态设置对话框名称
 选填数据：
 addRules:如果增加校验规则，文件中添加addRules
*/
/** 组件定义 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
export const mixin_bid_score = {
  mixins: [],
  /** 组件数据 */
  data() {
    return {
      fullScoreInfo: {},
      url: {
        fullScoreUpdate: '/mpm/projectBidFullScore/update'
      },
      saveValue: '0' // 高于分数的数据库记录值
    }
  },
  /** 计算 */
  computed: {
  },
  /** 组件方法 */
  methods: {
    changescore() {
      // 满分
      let totalfullscore = parseFloat(this.fullScoreInfo.requirescore)
      if (totalfullscore > 100) {
        this.$tap.alert('不能大于100！')
        this.fullScoreInfo.requirescore = '100'
        return
      }
      if (totalfullscore < parseFloat(this.saveValue)) {
        this.$tap.alert('该值只能递增！')
        this.fullScoreInfo.requirescore = this.saveValue
        return
      }
    },
    getFullScoreInfo(info) {
      this.fullScoreInfo = info
      if (!this.fullScoreInfo.requirescore) {
        this.$set(this.fullScoreInfo, "requirescore", '90')
      }
      this.saveValue = this.fullScoreInfo.requirescore
    },
    async fullScoreUpdate(data) {
      return putAction(this.url.fullScoreUpdate, data)
    }
  },
  /** 组件创建 */
  created() {
  }
}
